#ifndef __MCURSES_H
#define __MCURSES_H
#include "matrix.h"

/* let the cursor to the end of the specified direction,
   just for the parameter of `cnt` that the following functions */
#define MX_MCURSES_TOEND -1

/* let the cursor keep there */
#define MX_MCURSES_KEEP 0

typedef enum
{
    MX_MCURSES_DIRECTION_UP,
    MX_MCURSES_DIRECTION_DOWN,
    MX_MCURSES_DIRECTION_LEFT,
    MX_MCURSES_DIRECTION_RIGHT
} mx_mcurses_direction;

/* get the size of terminal window */
void mx_mcurses_windsize (void);
/* move the cursor with direction, if the `cnt` equals MX_MCURSES_TOEND,
   the cursor will move to the end of the direction */
void mx_mcurses_move (mx_mcurses_direction dir, mx_size_t cnt);
/* move the cursor to anywhere by line and colume */
void mx_mcurses_goto (mx_usize_t line, mx_usize_t col);
/* delete from current cursor position to target position which depend on the spcified `dir` and `cnt`,
   if the `cnt` equals MX_MCURSES_TOEND, the target position is end of the direction */
void mx_mcurses_delete (mx_mcurses_direction dir, mx_size_t cnt);
/* insert string in current position */
void mx_mcurses_insert (mx_string_pt str, mx_string_pt after);
/* insert char in current position */
void mx_mcurses_insertc (char c, mx_string_pt after);
/* clear line */
void mx_mcurses_clearline (void);
/* clear full screen */
void mx_mcurses_clear (void);
/* new line */
void mx_mcurses_newline (void);

#endif
